package fr.insta.psape.service;

import fr.insta.psape.domaine.dao.FactoryDao;
import fr.insta.psape.domaine.dao.IDao;
import fr.insta.psape.domaine.entity.User;


public class ServiceUser {

    private User user;
    
    public ServiceUser() {
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
    
    public String save() {
        IDao daoU = FactoryDao.getDAO("User");
        String msg = daoU.insert(user);
        return msg;
    }
    
    public String autentification() {
        IDao daoU = FactoryDao.getDAO("User");
        String rep = daoU.get(this.user);
        return rep;
    }
    
}
